package com.it.conformity.testdemo.service.impl;

import com.it.conformity.testdemo.dao.SysUserDao;
import com.it.conformity.testdemo.pojo.SysUser;
import com.it.conformity.testdemo.service.SysUserService;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import javax.annotation.Resource;

/**
 * @Author: 王文龙
 * @Date: 2020/6/1911:11
 * @Version: 1.0
 * @Describe: 描述:
 */
@Service
public class SysUserServiceImpl implements SysUserService {


    @Resource
    private SysUserDao sysUserDao;


    /**
     * 新增
     *
     * @param sysUser 用户实体类
     * @return true/false
     */
    @Override
    public boolean insert(SysUser sysUser) {
        return sysUserDao.insert(sysUser);
    }


    /**
     * id查询
     *
     * @param id 主键
     * @return SysUser
     */
    @Override
    public SysUser findById(Integer id) {
        Assert.notNull(id,"id不可为空");
        return sysUserDao.findById(id);
    }
}
